package com.travel.admin.util;




import com.travel.admin.enums.LogLevelEnum;
import com.travel.admin.thread.LogThread;

import java.util.concurrent.ExecutorService;

/**
 * @desc:
 */
public class LogUtil {
    private static ExecutorService singleThreadPool;


    /**
     * 单线程异步处理日志
     * @param levelEnum
     * @param key
     * @param message
     */
    public static void addLog(LogLevelEnum levelEnum, String key, Object... message){
        try {
            singleThreadPool = SingleThreadPool.getThreadPool();
            LogThread process = new LogThread(levelEnum, key, message);
            singleThreadPool.execute(process);
        } catch (Exception e) {
        }
    }
}
